package com.dazzle.system.dao.impl;

import java.util.List;

import com.dazzle.core.dao.impl.GenericDaoImpl;
import com.dazzle.system.dao.SysUserDao;
import com.dazzle.system.entity.SysUser;

@SuppressWarnings("unchecked")
public class SysUserDaoImpl extends GenericDaoImpl<SysUser,Long> implements SysUserDao{

	public SysUserDaoImpl() {
		super(SysUser.class);
	}

	public SysUser getUserByUserName(String userName) {
		String hql ="from SysUser su where su.userName = ?";
		List<SysUser> list = findByHql(hql, new Object[]{userName});	
		if(list.size()>0){
			return list.get(0);
		}
		return null;
	}
	
}